#pragma once

#include "ContactManifold.h"
#include "Primitive.h"

class BodyInfo; 


class Circle : public Primitive
{
public:
	Circle(void);
	~Circle(void);

	void		CalculatePhysics(float dt);
	void		CollisionWithCircle(Circle* circle, ContactManifold *contactManifold, float dt);
	void		Update(float dt);
	

	float		GetRadius() const;

	int			support;

	bool		isNaN(Vector v); 

	void		CollisionResponseWithCircle(ManifoldPoint& point, float dt);
	void		CollisionResponseWithLine(ManifoldPoint& point, float dt);
	void		CollisionResponseWith(ManifoldPoint& point, float dt);

	void		CollisionResponseWithLine2(ManifoldPoint& point, float dt);
	
	virtual		Vector vectorTo(Vector p);


	

	int			getCellX() { return (int)m_cell.GetX(); }
	int			getCellY() { return (int)m_cell.GetY(); }

	void		updateCell();
	Vector&		cell();

private:

	float		m_radius;
	Vector		m_cell;
};

